﻿#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <list>
#include "../../../NetEngine_Linux/NetEngine_SourceCode/XyRyNet_CommHdr.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/XyRyNet_Types.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/NetEngine_Lib/NetEngine_BaseLib/BaseLib_Define.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/NetEngine_SystemSdk/NetEngine_ProcSdk/ProcFile_Define.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/NetEngine_SystemSdk/NetEngine_ProcSdk/ProcFile_Error.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/NetEngine_SystemSdk/NetEngine_SystemApi/SystemApi_Define.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/NetEngine_SystemSdk/NetEngine_SystemApi/SystemApi_Error.h"

//g++ -std=gnu++11 -Wall -g TestFor_Api.cpp -o TestFor_Api -L ../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_BaseLib -L ../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_Core -L ../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_SystemSdk -lNetEngine_BaseLib -lNetEngine_Core -lNetEngine_Algorithm -lNetEngine_ProcSdk -lNetEngine_SystemApi -Wl,-rpath=../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_BaseLib:../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_Core:../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_SystemSdk,--disable-new-dtags

int Test_Serial()
{
    SYSTEMAPI_CPU_INFOMATION st_CPUInfo;
    SYSTEMAPI_SERIAL_INFOMATION st_SDKSerial;

    memset(&st_CPUInfo,'\0',sizeof(SYSTEMAPI_CPU_INFOMATION));
    memset(&st_SDKSerial,'\0',sizeof(SYSTEMAPI_SERIAL_INFOMATION));

    if (SystemApi_HardWare_GetCpuInfomation(&st_CPUInfo))
    {
        printf("%s\n",st_CPUInfo.tszCpuName);
    }

    _tcscpy(st_SDKSerial.tszMacAddress,"ens33");
    _tcscpy(st_SDKSerial.tszBaseBoardSerial,"vm");
    if (SystemApi_HardWare_GetSerial(&st_SDKSerial))
    {
    }
    return 0;
}
int Test_Process()
{
    DWORD dwProcessId;
    if (!SystemApi_Process_CreateProcess(&dwProcessId,"./Test_TcpClient"))
    {
        printf("SystemApi_Process_CreateProcess:%lX",SystemApi_GetLastError());
    }
    sleep(10);
    SystemApi_Process_Stop(NULL,dwProcessId);
    return 0;
}

int main()
{
    DWORD dwOSBuild = 0;
    DWORD dwOSProcessor = 0;
    TCHAR tszOSBuffer[MAX_PATH];
    TCHAR tszOSVersion[MAX_PATH];

    memset(tszOSBuffer, '\0', MAX_PATH);
    memset(tszOSVersion,'\0',MAX_PATH);

    SystemApi_System_GetSystemVer(tszOSBuffer, tszOSVersion, &dwOSBuild, &dwOSProcessor);
    Test_Process();
    return 0;
}
